using System;
using System.Data;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//using Auto.Data.Systems.BLL;
//using Auto.Data.Systems.Model;
using Auto.Data.Security;
using BLL = Auto.Data.Systems.BLL;

namespace BaseSystem._System
{
    public partial class SystemsRoles : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindGridView();
            }
        }
        public void BindGridView()
        {
            GridView1.DataSource = new BLL.Systems().GetSystems();//Auto.Data.Systems.BLL.Systems.Instance.GetAllList(); //Systems.getSystems(false);
            GridView1.DataBind();
        }
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName)
            {
                case "NewRole":
                    int rowIndex = Convert.ToInt32(e.CommandArgument);

                    string sysID = ((Label)GridView1.Rows[rowIndex].FindControl("lblSysID")).Text;
                    string sysName = ((Label)GridView1.Rows[rowIndex].FindControl("lblSysName")).Text;
                    UcRoleMenu1.Visible = true;
                    UcRoleMenu1.New(sysID, sysName);
                    break;
                default: break;
            }
        }

    }
}
